/**
 * Created by hejg on 2018/5/10.
 */
import {observable, computed, action} from 'mobx';

export default class FormStore {
    @observable
    a4Code = '';//登陆工号
    @observable
    password = '';//登陆密码
    @observable
    valicode = '';//验证码
    @observable
    remember = false;//是否记录密码
    @observable
    showValicode = false;//是否显示验证码控件

    @action
    setValue = (name, value) => {
        this[name] = value;
    }

    @computed
    get submitDisabled() {
        if (this.showValicode && this.a4Code && this.password && this.valicode) {
            return true;
        } else if (!this.showValicode && this.a4Code && this.password) {
            return true;
        } else {
            return false;
        }
    }
}